CONSTSTR MYRTLEXP CVT_G2CoordsStr( char *buff, size_t bsz,
                                   const GCoord_t& x, const GCoord_t& y,
                                   Coordinate_Type cs, int dn, degTypes dt, char *dlm )
  {  Coordinate_Tuple sgc;
     Parameter_Tuple  sgp;

     sgc.Mercator.easting  = x;
     sgc.Mercator.northing = y;

     sgp.Mercator.origin_latitude   = 0;
     sgp.Mercator.central_meridian  = 0;
     sgp.Mercator.scale_factor      = 1;
     sgp.Mercator.false_easting     = 0;
     sgp.Mercator.false_northing    = 0;

 return CVT_Coord2Str( buff, bsz,
                       sgc, sgp, SYS_COORDSYS, SYS_DATUM,
                       cs, dn, dt, dlm );
}

bool MYRTLEXP CVT_LatLon2G( double x, double y, int dn, PMVProjectionInfo pr, GPoint& gp )
  {  Coordinate_Tuple sgc;
     Parameter_Tuple  sgp;
     Coordinate_Tuple dgc;
     Parameter_Tuple  dgp;

     sgc.Geodetic.longitude   = G2Rad( x );
     sgc.Geodetic.latitude    = G2Rad( y );
     sgc.Geodetic.height      = 0;

     sgp.Geodetic.height_type = No_Height;

     if ( pr ) {
       dgp.Mercator.origin_latitude  = pr->origin_latitude;
       dgp.Mercator.central_meridian = pr->central_meridian;
       dgp.Mercator.scale_factor     = pr->scale;
       dgp.Mercator.false_easting    = pr->false_easting;
       dgp.Mercator.false_northing   = pr->false_northing;
     } else {
       dgp.Mercator.origin_latitude  = 0;
       dgp.Mercator.central_meridian = 0;
       dgp.Mercator.scale_factor     = 1;
       dgp.Mercator.false_easting    = 0;
       dgp.Mercator.false_northing   = 0;
     }

     if ( !CVT_Coord2Coord( sgc, sgp, Geodetic, dn,
                            dgc, dgp, SYS_COORDSYS, SYS_DATUM ) )
       return false;

     gp.x = dgc.Mercator.easting;
     gp.y = dgc.Mercator.northing;
 return true;
}

bool MYRTLEXP CVT_G2LatLon( const GPoint& p, int dn, PMVProjectionInfo pr, double& x, double& y )
  {  Coordinate_Tuple sgc;
     Parameter_Tuple  sgp;
     Coordinate_Tuple dgc;
     Parameter_Tuple  dgp;

     sgc.Mercator.easting  = p.x;
     sgc.Mercator.northing = p.y;

     if ( pr ) {
       sgp.Mercator.origin_latitude  = pr->origin_latitude;
       sgp.Mercator.central_meridian = pr->central_meridian;
       sgp.Mercator.scale_factor     = pr->scale;
       sgp.Mercator.false_easting    = pr->false_easting;
       sgp.Mercator.false_northing   = pr->false_northing;
     } else {
       sgp.Mercator.origin_latitude  = 0;
       sgp.Mercator.central_meridian = 0;
       sgp.Mercator.scale_factor     = 1;
       sgp.Mercator.false_easting    = 0;
       sgp.Mercator.false_northing   = 0;
     }

     dgp.Geodetic.height_type = No_Height;

     if ( !CVT_Coord2Coord( sgc, sgp, SYS_COORDSYS, SYS_DATUM,
                            dgc, dgp, Geodetic, dn ) )
       return false;

     x = Rad2G( dgc.Geodetic.longitude );
     y = Rad2G( dgc.Geodetic.latitude );

 return true;
}
